package net.toby200.canalbuddy.notices.notification;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import net.toby200.canalbuddy.notices.Event;

import java.util.logging.Logger;

import de.greenrobot.event.EventBus;

public class NotificationClearedReceiver extends BroadcastReceiver {

    private static final Logger LOG = Logger.getLogger(NotificationClearedReceiver.class.getName());

    public NotificationClearedReceiver() {
    }

    // callback when notification is cleared. This may contain one or many notices
    @Override
    public void onReceive(Context context, Intent intent) {
        LOG.info("Notification cleared, wiping pending notice notifications");
        EventBus.getDefault().post(new Event.ClearNoticeNotificationsEvent());
    }
}
